import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';

/**
 * Generated class for the CoffeeDetailPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage({
  name: 'coffee-detail',
  segment: 'coffee/detail'
})
@Component({
  selector: 'page-coffee-detail',
  templateUrl: 'coffee-detail.html',
})
export class CoffeeDetailPage {
  item: any; // 咖啡详情
  constructor(public navCtrl: NavController, public navParams: NavParams) {
    // 判断是否有数据
    // if (Object.keys(navParams.data).length > 0 ) {
      this.item = navParams.data;
    // }
  }

  // 前往支付页面
  goPay() {
    this.navCtrl.push('pay');
  }
}
